<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>MyBlog | 权限列表</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="../../static/build/css/app.min.css" th:href="${#fn.getStaticFile('/build/css/app.min.css')}">
    <link rel="stylesheet" href="../../static/dist/css/common.css" th:href="${#fn.getStaticFile('/dist/css/common.css')}">
    <script src="../../static/build/js/app.min.js" th:src="${#fn.getStaticFile('/build/js/app.min.js')}"></script>
    <script src="../../static/dist/js/common.js" th:src="${#fn.getStaticFile('/dist/js/common.js')}"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini " th:classappend="${#session.getAttribute('sidebarClass')}" th:with="pageCode='permissionList'">
    <div class="wrapper">
    <!-- Main Header -->
    <div th:replace="fragment/layout :: header"></div>
    <!-- Left side column. contains the logo and sidebar -->
    <div th:replace="fragment/layout :: menu(activePageCode=${pageCode})"></div>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Main content -->
        <section class="content">
            <div id="search-modal" class="modal" tabindex="-1" data-width="760" data-max-height="420" style="display: none;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">过滤</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <form id="search-form" class="form-horizontal pageable-search-form" data-condition-span=".condition">
                            <div th:utext="${#fn.getPageInput(s.pageable)}"></div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label" for="name">权限名称</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control " th:value="${s.params.get('name')}" name="name" id="name" data-label="权限名称">
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary pageable-search-button">确定</button>
                </div>
            </div>
            <!-- Nav tabs -->
            <ul th:replace="fragment/menuTab :: menuTab(activePageCode=${pageCode})"></ul>
            <div class="panel panel-info">
                <div th:if="${message!=null}"  th:class="'alert alert-'+${message.type}" th:text="${message.code}"></div>
                <div class="panel-body" >
                    <div class="panel-heading">
                        <a class="btn btn-info" href="#" th:href="@{/sys/permission/form}">
                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>添加
                        </a>
                        <button class="btn btn-info" data-toggle="modal" id="btnFilter" href="#search-modal">
                            <span class="glyphicon glyphicon-filter" aria-hidden="true"></span> 过滤
                        </button>
                        <span class="condition"></span>
                    </div>
                    <div class="pageable-table" data-search-form="#search-form">
                        <table class=" table table-bordered table-striped dataTable ">
                            <thead>
                            <tr role="row">
                                <th class="pageable-order  " data-sort-name="name" >权限名称</th>
                                <th class="pageable-order  " data-sort-name="code" >权限编码</th>
                                <th class="pageable-order  " data-sort-name="menu_id" >菜单名称</th>
                                <th class="pageable-order  " data-sort-name="created_by" >创建人</th>
                                <th class="pageable-order  " data-sort-name="created_date" >创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="permission:${page.content}">
                                <td th:text="${permission.name}">AA</td>
                                <td th:text="${permission.code}">sys:account:list</td>
                                <td th:text="${#fn.getMenu(permission.menuId).name}">BB</td>
                                <td th:text="${#fn.getAccount(permission.createdBy).loginName}">SA</td>
                                <td th:text="${#fn.formatLocalDateTime(permission.lastModifiedDate)}">2012-10-22</td>
                                <td>
                                    <a sec:authorize="hasAnyAuthority('PERM_sys:permission:list:edit')" href="#" th:href="@{/sys/permission/form(id=${permission.id})}">修改</a>&nbsp;&nbsp;
                                    <a sec:authorize="hasAnyAuthority('PERM_sys:permission:list:delete')" th:data-deletable="${permission.deletable}" href="javascript:void(0);" th:data-label="${'确认删除' + permission.name + '?'}" th:data-href="@{/sys/permission/delete(id=${permission.id})}" class="common-confirm-href">删除</a>&nbsp;&nbsp;
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div th:include="fragment/pagination :: pagination(page=${page})">
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <div th:replace="fragment/layout :: footer"></div>
</div>
</body>
</html>